package com.yuanyu.controller;

import com.yuanyu.common.util.ResultInfoUtil;
import com.yuanyu.model.vo.Pump_maintenance_and_disassembly_reportVO;
import com.yuanyu.model.vo.ResultInfo;
import com.yuanyu.server.ITestPart3Server;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/part3")
public class TestPart3Controller {
    @Autowired
    private ITestPart3Server testPart3Server;

    @GetMapping("/test")
    public ResultInfo test(){
        System.out.println("这是测试界面");
        return ResultInfoUtil.buildSuccess(testPart3Server.test());
    }
    @PostMapping("/add")
    public ResultInfo part(@RequestBody Pump_maintenance_and_disassembly_reportVO pumpMaintenanceAndDisassemblyReportVO){
        System.out.println(pumpMaintenanceAndDisassemblyReportVO.toString());
        return ResultInfoUtil.buildSuccess(testPart3Server.test3(pumpMaintenanceAndDisassemblyReportVO));
    }
    @PostMapping("/update")
    public ResultInfo updatePart(@RequestBody Pump_maintenance_and_disassembly_reportVO pumpMaintenanceAndDisassemblyReportVO){
        System.out.println(pumpMaintenanceAndDisassemblyReportVO.toString());
        return ResultInfoUtil.buildSuccess(testPart3Server.updateTable3(pumpMaintenanceAndDisassemblyReportVO));
    }
    @GetMapping("/value/{Case}")
    public ResultInfo partValue(@PathVariable("Case") String Case){
        System.out.println(Case);
        return ResultInfoUtil.buildSuccess(testPart3Server.getTest3(Case));
    }
}
